{
GtkPlacesSidebar *sidebar = user_data;
GError *error = NULL;
+ GDBusProxy *proxy;
- sidebar->hostnamed_proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- g_clear_object (&sidebar->hostnamed_cancellable);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
- g_object_unref (sidebar);
+ sidebar->hostnamed_proxy = proxy;
+ g_clear_object (&sidebar->hostnamed_cancellable);
if (error != NULL) {
g_debug ("Failed to create D-Bus proxy: %s", error->message);
"org.freedesktop.hostname1",
sidebar->hostnamed_cancellable,
hostname_proxy_new_cb,
- g_object_ref (sidebar));
+ sidebar);
sidebar->drop_state = DROP_STATE_NORMAL;
sidebar->new_bookmark_index = -1;